package org.exaple.mp.intercept;

import org.apache.ibatis.plugin.Invocation;
import org.springframework.core.Ordered;

/**
 * 自定义 mybatis plus 查询拦截器
 *
 */
public interface QueryInterceptor extends Ordered {

	/**
	 * 拦截处理
	 *
	 * @param invocation 调用器
	 * @return Object
	 * @throws Throwable
	 */
	Object intercept(Invocation invocation) throws Throwable;

	/**
	 * 排序
	 *
	 * @return int
	 */
	@Override
	default int getOrder() {
		return Ordered.LOWEST_PRECEDENCE;
	}
}
